package com.eveinfo.api.character.skillqueue;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import com.eveinfo.api.AbstractApiParser;
import com.eveinfo.api.ApiAuth;
import com.eveinfo.api.ApiException;
import com.eveinfo.api.NoCacheFoundExecption;

public class SkillQueueParser extends AbstractApiParser<SkillQueueResponse, SkillQueueHandler> {

	protected static final String CHARACTER_SHEET_URL = Path.CHARACTER.getPath() + "/SkillQueue.xml.aspx";

	private static SkillQueueParser instance;
	
	public static SkillQueueParser getInstance(){
		if(instance == null){
			instance = new SkillQueueParser();
		}
		return instance;
	}
	
	private SkillQueueParser() {
		super(SkillQueueResponse.class, 1, CHARACTER_SHEET_URL);
	}

	public SkillQueueResponse getSkillsInQueue(ApiAuth auth) throws IOException,
			SAXException, ParserConfigurationException, ApiException, NoCacheFoundExecption {
		SkillQueueHandler handler = new SkillQueueHandler();
		return getResponse(auth, handler);
	}

	public static boolean isInstancier() {
		return instance != null;
	}
}
